/*
 *  shnode_color.cpp
 *  shaderz_v3
 *
 *  Created by Anjali on 4/14/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#include "shnode_color.h"

using namespace shaderz;

shNodeColor::shNodeColor( const std::string& InNodeName, float InRed, float InGreen, float InBlue, float InAlpha )
	: ParentClass(InNodeName)
{
	// add default output stubs
	mRGBAStub = constructLinkStub("RGBA", SHIO_OUTPUT, SHST_RGBA );
	mRGBAStub->type = SHST_RGBA;
	mRGBAStub->value.constant4Vec[0] = InRed;
	mRGBAStub->value.constant4Vec[1] = InGreen;
	mRGBAStub->value.constant4Vec[2] = InBlue;
	mRGBAStub->value.constant4Vec[3] = InAlpha;
	addOutputStub( mRGBAStub );
	
	mRedStub = constructLinkStub("Red", SHIO_OUTPUT, SHST_RED );
	mRedStub->value.constant1Vec = InRed;
	addOutputStub( mRedStub );

	mGreenStub = constructLinkStub("Green", SHIO_OUTPUT, SHST_GREEN );
	mGreenStub->value.constant1Vec = InGreen;
	addOutputStub( mGreenStub );

	mBlueStub = constructLinkStub("Blue", SHIO_OUTPUT, SHST_BLUE );
	mBlueStub->value.constant1Vec = InBlue;
	addOutputStub( mBlueStub );

	mAlphaStub = constructLinkStub("Alpha", SHIO_OUTPUT, SHST_ALPHA );
	mAlphaStub->value.constant1Vec = InAlpha;
	addOutputStub( mAlphaStub );
}